package com.zzw.utils;
/**
 * 字符串操作类
 *
 */
public class StringTools {

	/**
	 * 将字符串首字母转为大写
	 * @param str
	 * @return
	 */
	public static String toUpperCaseFirstOne(String str) {
		if (Character.isUpperCase(str.charAt(0)))
			return str;
		else
			return (new StringBuilder()).append(
					Character.toUpperCase(str.charAt(0))).append(
					str.substring(1)).toString();
	}
	/**
	 * 将字符串首字母转为小写
	 * @param str
	 * @return
	 */
	public static String toLowerCaseFirstOne(String s) {
		if (Character.isLowerCase(s.charAt(0)))
			return s;
		else
			return (new StringBuilder()).append(
					Character.toLowerCase(s.charAt(0))).append(s.substring(1))
					.toString();
	}
}
